#ifndef CONSTANT_MEDIUM_H
#define CONSTANT_MEDIUM_H


#include "hittable.h"
#include "material.h"
#include "texture.h"

class ConstantMedium : public Hittable {
public:
    ConstantMedium(shared_ptr<Hittable> boundary, double density, shared_ptr<Texture> tex);

    ConstantMedium(shared_ptr<Hittable> boundary, double density, const Color& albedo);

    bool hit(const Ray& r, Interval ray_t, HitRecord& rec) const override;

    AABB bounding_box() const override { return boundary->bounding_box(); }

private:
    shared_ptr<Hittable> boundary;
    double neg_inv_density;
    shared_ptr<Material> phase_function;
};

#endif